
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<HTML>

<HEAD>
   <TITLE>ltime_c</TITLE>
</HEAD>

<BODY style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<A name="TOP"></A>

<table style="text-align: left; margin-left: auto; margin-right: auto; width: 800px;"
 border="0" cellpadding="5" cellspacing="2">
  <tbody>
    <tr>
      <td style="background-color: rgb(153, 153, 153); vertical-align: middle; text-align: center;">
      <div align="right"> 
      <small><small><a href="index.html">Index Page</a></small></small>
      </div>
      <b>ltime_c</b> </td>
    </tr>

    <tr>
      <td style="vertical-align: top;">

<small><div align="center">
<A HREF="index.html#A">A</A>&nbsp;
<A HREF="index.html#B">B</A>&nbsp;
<A HREF="index.html#C">C</A>&nbsp;
<A HREF="index.html#D">D</A>&nbsp;
<A HREF="index.html#E">E</A>&nbsp;
<A HREF="index.html#F">F</A>&nbsp;
<A HREF="index.html#G">G</A>&nbsp;
<A HREF="index.html#H">H</A>&nbsp;
<A HREF="index.html#I">I</A>&nbsp;
<A HREF="index.html#J">J</A>&nbsp;
<A HREF="index.html#K">K</A>&nbsp;
<A HREF="index.html#L">L</A>&nbsp;
<A HREF="index.html#M">M</A>&nbsp;
<A HREF="index.html#N">N</A>&nbsp;
<A HREF="index.html#O">O</A>&nbsp;
<A HREF="index.html#P">P</A>&nbsp;
<A HREF="index.html#Q">Q</A>&nbsp;
<A HREF="index.html#R">R</A>&nbsp;
<A HREF="index.html#S">S</A>&nbsp;
<A HREF="index.html#T">T</A>&nbsp;
<A HREF="index.html#U">U</A>&nbsp;
<A HREF="index.html#V">V</A>&nbsp;
<A HREF="index.html#W">W</A>&nbsp;
<A HREF="index.html#X">X</A>&nbsp;
</div></small>
       <br>
       <table style="text-align: left; width: 60%; margin-left: auto; margin-right: auto;"
       border="0" cellspacing="2" cellpadding="2">
        <tbody>
          <tr>
            <td style="width: 50%; text-align: center;">
            <small>
              <a href="#Procedure">Procedure<br></a>
              <a href="#Abstract">Abstract<br></a>
              <a href="#Required_Reading">Required_Reading<br></a>
              <a href="#Keywords">Keywords<br></a>
              <a href="#Brief_I/O">Brief_I/O<br></a>
              <a href="#Detailed_Input">Detailed_Input<br></a>

              </small>
              </td>
              <td style="vertical-align: top; width: 50%; text-align: center;">
              <small>               <a href="#Detailed_Output">Detailed_Output<br></a>
              <a href="#Parameters">Parameters<br></a>
              <a href="#Exceptions">Exceptions<br></a>
              <a href="#Files">Files<br></a>
              <a href="#Particulars">Particulars<br></a>
              <a href="#Examples">Examples<br></a>

              </small>
              </td>
              <td style="vertical-align: top; width: 50%; text-align: center;">
              <small>               <a href="#Restrictions">Restrictions<br></a>
              <a href="#Literature_References">Literature_References<br></a>
              <a href="#Author_and_Institution">Author_and_Institution<br></a>
              <a href="#Version">Version<br></a>
              <a href="#Index_Entries">Index_Entries<br></a>
             </small>
            </td>
          </tr>
        </tbody>
</table>

<h4><a name="Procedure">Procedure</a></h4>
<PRE>
   void ltime_c ( SpiceDouble        etobs,
                  SpiceInt           obs,
                  ConstSpiceChar   * dir,
                  SpiceInt           targ,
                  SpiceDouble      * ettarg,
                  SpiceDouble      * elapsd  ) 

</PRE>
<h4><a name="Abstract">Abstract</a></h4>
<PRE>
 
   This routine computes the transmit (or receive) time 
   of a signal at a specified target, given the receive 
   (or transmit) time at a specified observer. The elapsed 
   time between transmit and receive is also returned. 
 </PRE>
<h4><a name="Required_Reading">Required_Reading</a></h4>
<PRE>
 
    None. 
 </PRE>
<h4><a name="Keywords">Keywords</a></h4>
<PRE>
 
     SPK 
 

</PRE>
<h4><a name="Brief_I/O">Brief_I/O</a></h4>
<PRE>
 
    VARIABLE  I/O  DESCRIPTION 
    --------  ---  -------------------------------------------------- 
    etobs      I   Epoch of a signal at some observer 
    obs        I   NAIF ID of some observer 
    dir        I   Direction the signal travels ( &quot;-&gt;&quot; or &quot;&lt;-&quot; ) 
    targ       I   NAIF ID of the target object 
    ettarg     O   Epoch of the signal at the target 
    elapsd     O   Time between transmit and receipt of the signal 
 </PRE>
<h4><a name="Detailed_Input">Detailed_Input</a></h4>
<PRE>
 
   etobs       is an epoch expressed in ephemeris seconds (TDB) 
               past the epoch of the J2000 reference system. 
               This is the time at which an electromagnetic 
               signal is &quot;at&quot; the observer. 
 
   obs         is the NAIF ID of some observer. 
 
   dir         is the direction the signal travels.  The 
               acceptable values are &quot;-&gt;&quot; and &quot;&lt;-&quot;.  When 
               you read the calling sequence from left to 
               right, the &quot;arrow&quot; given by DIR indicates 
               which way the electromagnetic signal is traveling. 
 
               If the argument list reads as below, 
 
                ..., obs, &quot;-&gt;&quot;, targ, ... 
 
               the signal is traveling from the observer to the 
               target. 
 
               If the argument reads as 
 
                ..., obs, &quot;&lt;-&quot;, targ 
 
               the signal is traveling from the target to 
               the observer. 
 
   targ        is the NAIF ID of the target. 
 </PRE>
<h4><a name="Detailed_Output">Detailed_Output</a></h4>
<PRE>
 
   ettarg      is the epoch, expressed in ephemeris seconds
               past J2000 TDB, at which the electromagnetic signal is
               &quot;at&quot; the target body.
 
               Note ettarg is computed using only Newtonian 
               assumptions about the propagation of light. 
 
   elapsd      is the number of ephemeris seconds (TDB) between 
               transmission and receipt of the signal. 
 
                  elapsd = fabs( etobs - ettarg )
 </PRE>
<h4><a name="Parameters">Parameters</a></h4>
<PRE>
 
    None. 
 </PRE>
<h4><a name="Exceptions">Exceptions</a></h4>
<PRE>
 
   1) If dir is not one of &quot;-&gt;&quot; or &quot;&lt;-&quot; the error SPICE(BADDIRECTION) 
      will be signalled.  In this case ettarg and elapsd will not be 
      modified.
       
   2) 
      If insufficient ephemeris information is available to compute the
      outputs ettarg and elapsd, or if observer or target are not
      recognized, the problem is diagnosed by a routine in the call
      tree of this routine.
 
      In this case, the value of ettarg will be set to etobs 
      and elapsd will be set to zero. 
 </PRE>
<h4><a name="Files">Files</a></h4>
<PRE>
 
    None. 
 </PRE>
<h4><a name="Particulars">Particulars</a></h4>
<PRE>
 
   Suppose a radio signal travels between two solar system objects.
   Given an ephemeris for the two objects, which way the signal is
   traveling, and the time when the signal is &quot;at&quot; at one of the
   objects (the observer obs), this routine determines when the signal
   is &quot;at&quot; the other object (the target targ).  It also returns the
   elapsed time between transmission and receipt of the signal.
 
 </PRE>
<h4><a name="Examples">Examples</a></h4>
<PRE>
 
     
    
   1) Suppose a signal is transmitted at time et from the Goldstone 
      tracking site (ID code 399001) to a spacecraft whose ID code 
      is -77. 
 
 
         signal traveling to spacecraft 
         *  -._.-._.-._.-._.-._.-._.-._.-._.-&gt;  * 
 
         Goldstone (obs=399001)            Spacecraft (targ = -77) 
         at epoch etobs(given)             at epoch ettarg(unknown) 
 
      Assuming that all of the required SPICE kernels have been 
      loaded, the code fragment below shows how to compute the 
      time (arrive) at which the signal arrives at the spacecraft 
      and how long (howlng) it took the signal to reach the spacecraft. 
      (Note that we display the arrival time as the number of seconds 
      past J2000.) 
 
         #include &lt;stdio.h&gt;
         #include &quot;SpiceUsr.h&quot;
               .
               .
               .
         #define  OBS            399001
         #define  TARG           -77
         #define  LENOUT         81
         #define  OBSUTC         &quot;1999 May 25&quot;
         #define  LSK            &quot;leapseconds.ker&quot;
         
         SpiceChar               timestr [ LENOUT ];
      
         SpiceDouble             arrive;
         SpiceDouble             howlng;
         SpiceDouble             etobs;
         SpiceDouble             sent;

   
         [ load kernels ]
         
         <a href="str2et_c.html">str2et_c</a> ( OBSUTC, &amp;etobs ); 
    
         <b>ltime_c</b> ( etobs,   OBS,    &quot;-&gt;&quot;,   TARG,  &amp;arrive, &amp;howlng );
         <a href="etcal_c.html">etcal_c</a> ( arrive,  LENOUT, timestr ); 
    
         printf ( &quot;The signal arrived at time: %s\n&quot;,       timestr ); 
         printf ( &quot;It took %15.6f seconds to get there.\n&quot;, howlng  ); 
 
 
   2) Suppose a signal is received at the Goldstone tracking sight 
      at epoch ET from the spacecraft of the previous example. 
 
              signal sent from spacecraft 
         *  &lt;-._.-._.-._.-._.-._.-._.-._.-._.- * 
 
         Goldstone (OBS=399001)               Spacecraft (TARG = -77) 
         at epoch ETOBS(given)                at epoch ETTARG(unknown) 
 
      Again assuming that all the required kernels have been loaded 
      the code fragment below computes the epoch at which the 
      signal was transmitted from the spacecraft. 
    
         <b>ltime_c</b> ( etobs,   OBS,    &quot;&lt;-&quot;,   TARG,  &amp;sent, &amp;howlng );
         <a href="etcal_c.html">etcal_c</a> ( sent,    LENOUT, timestr ); 
    
         printf ( &quot;The signal was transmitted at: %s\n&quot;,    timestr ); 
         printf ( &quot;It took %15.6f seconds to get there.\n&quot;, howlng ); 
    
 
   3) Suppose there is a transponder on board the spacecraft of 
      the previous examples that transmits a signal back to the 
      sender exactly 1 microsecond after a signal arrives at 
      the spacecraft.  If we send a signal from Goldstone 
      to the spacecraft and wait to receive it at Canberra. 
      What will be the epoch at which the return signal arrives 
      in Canberra? ( The ID code for Canberra is 399002 ). 
    
      Again, assuming we've loaded all the necessary kernels, 
      the fragment below will give us the answer. 
 
         #define   GSTONE        399001
         #define   SC            -77
         #define   CANBER        399002
 
         <a href="str2et_c.html">str2et_c</a> ( OBSUTC, &amp;etgold ); 
  
         <b>ltime_c</b> ( etgold, GSTONE, &quot;-&gt;&quot;, SC, &amp;scget, &amp;lt1 ); 
 
         /.
         Account for the microsecond delay between receipt and 
         transmission. 
         ./
         scsend = scget + 0.000001; 
 
         <b>ltime_c</b> ( scsend, SC, &quot;-&gt;&quot;, CANBER, &amp;etcanb, &amp;lt2 ); 
 
         rndtrp = etcanb - etgold;
 
         printf ( &quot;The  signal arrives in Canberra at ET: %15.6f\n&quot; 
                  &quot;Round trip time for the signal was:    %15.6f\n&quot;, 
                  etcanb,
                  rndtrp                                            ); 
 </PRE>
<h4><a name="Restrictions">Restrictions</a></h4>
<PRE>
 
   None. 
 </PRE>
<h4><a name="Literature_References">Literature_References</a></h4>
<PRE>
 
    None. 
 </PRE>
<h4><a name="Author_and_Institution">Author_and_Institution</a></h4>
<PRE>
 
    N.J. Bachman    (JPL)
    W.L. Taber      (JPL) 
 </PRE>
<h4><a name="Version">Version</a></h4>
<PRE>
 
   -CSPICE Version 1.0.1, 09-NOV-2006   (NJB)

      Corrected a reference to the function <a href="j2000_c.html">j2000_c</a>; this had been
      erroneously changed from the name J2000 to <a href="j2000_c.html">j2000_c</a> 
      during translation from Fortran.

      Re-ordered header sections to conform to standard.

   -CSPICE Version 1.0.0, 29-MAY-1999 (WLT) (NJB)
</PRE>
<h4><a name="Index_Entries">Index_Entries</a></h4>
<PRE>
 
   Compute uplink and downlink light time 
 </PRE>
<h4>Link to routine ltime_c source file <a href='../../../src/cspice/ltime_c.c'>ltime_c.c</a> </h4>

      </td>
    </tr>
  </tbody>
</table>

   <pre>Wed Jun  9 13:05:26 2010</pre>

</body>
</html>

